#include <stdio.h>

int Bottle(int N) {
    if (N > 1) {
        return N /2 + Bottle(N / 2 + N % 2);
    }
    return 0;
}

int main() {
    int money = 0;
    scanf("%d", &money);
    int ret = Bottle(money) + money;
    printf("%d", ret);
    return 0;
}